package a.j;

import a.c.cb;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.u;
import a.d.n;
import a.d.t;
import a.j.a.j;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class pf
  extends gf
{
  private e m;
  private boolean G;
  private boolean H = true;
  private boolean I;
  private boolean J = true;
  private boolean K = true;
  private boolean L = false;
  private KeyListener M;
  private u N;
  private PropertyChangeListener O = new PropertyChangeListener()
  {
    public void propertyChange(PropertyChangeEvent paramAnonymousPropertyChangeEvent)
    {
      boolean bool = ld.E;
      if (!bool) {
        if ((pf.this.N != null) && ((bool) || ((paramAnonymousPropertyChangeEvent.getOldValue() instanceof g))))
        {
          ((g)paramAnonymousPropertyChangeEvent.getOldValue()).b(pf.this.N);
          pf.this.N = null;
        }
      }
      pf.this.Q();
    }
  };
  private int P = 27;
  private f_ Q = new f_();
  private e R;
  private e S;
  private d T;
  private boolean U;
  private boolean V;
  private boolean W;
  private double X;
  private boolean Y = true;
  private int Z = 10;
  private boolean ab = true;
  private List bb;
  private List cb;
  private boolean db;
  private z eb;
  private z.t_ fb;
  private boolean gb;
  private boolean hb;
  private boolean ib;
  private boolean jb;
  private e kb;
  private boolean lb;
  private boolean mb;
  private boolean nb = true;
  private jd ob;
  private jd pb;
  private jd qb;
  private int rb = 2;
  public static int sb;
  
  public pf(df paramdf)
  {
    super(paramdf);
  }
  
  public z v()
  {
    if (!ld.E) {
      if (this.eb == null) {
        this.eb = w();
      }
    }
    return this.eb;
  }
  
  public void a(z paramz)
  {
    if (!ld.E) {
      if (this.eb != null) {
        this.eb.g();
      }
    }
    this.eb = paramz;
  }
  
  protected z w()
  {
    z localz = new z(this.i);
    localz.c(true);
    localz.h(true);
    localz.c(15.0D);
    localz.e(20.0D);
    return localz;
  }
  
  public pf()
  {
    this(null);
  }
  
  public void f()
  {
    this.H = true;
  }
  
  public boolean x()
  {
    return this.mb;
  }
  
  public void g(boolean paramBoolean)
  {
    this.mb = paramBoolean;
  }
  
  public boolean y()
  {
    return this.nb;
  }
  
  public void h(boolean paramBoolean)
  {
    this.nb = paramBoolean;
  }
  
  public boolean z()
  {
    return this.lb;
  }
  
  public void i(boolean paramBoolean)
  {
    this.lb = paramBoolean;
  }
  
  public boolean A()
  {
    return this.jb;
  }
  
  public void j(boolean paramBoolean)
  {
    this.jb = paramBoolean;
  }
  
  public boolean B()
  {
    return this.ib;
  }
  
  public void k(boolean paramBoolean)
  {
    this.ib = paramBoolean;
  }
  
  public double C()
  {
    return this.X;
  }
  
  public void c(double paramDouble)
  {
    this.X = paramDouble;
  }
  
  public boolean D()
  {
    return this.db;
  }
  
  public void l(boolean paramBoolean)
  {
    this.db = paramBoolean;
  }
  
  public void m(boolean paramBoolean)
  {
    this.J = paramBoolean;
  }
  
  public boolean F()
  {
    return this.J;
  }
  
  public void n(boolean paramBoolean)
  {
    this.K = paramBoolean;
  }
  
  public boolean G()
  {
    return this.K;
  }
  
  public void mousePressedLeft(double paramDouble1, double paramDouble2)
  {
    this.L = true;
    b(paramDouble1, paramDouble2, false);
  }
  
  public void mouseShiftPressedLeft(double paramDouble1, double paramDouble2)
  {
    this.L = true;
    b(paramDouble1, paramDouble2, true);
  }
  
  static int a(byte paramByte, ld paramld)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    int i = 0;
    m localm1 = paramld.n().l();
    g localg = paramld.S();
    m localm2 = localm1;
    label85:
    do
    {
      if (!localm2.e()) {
        break;
      }
      d locald = localm2.a();
      tb localtb = localg.t(locald);
      e locale = paramld.n();
      a.d.y localy = localg.n(locald);
      if (locald.e() == locale) {
        b = -1;
      }
      n localn;
      double d1;
      do
      {
        do
        {
          if (b + 1 < localtb.n())
          {
            if (bool1) {
              break;
            }
            if (paramld.f(localtb.b(b + 1).b(), localtb.b(b + 1).c()))
            {
              b++;
              if (!bool1) {
                break label85;
              }
            }
          }
          localn = localy.a(b + 1);
          d1 = localn.e().a - localn.d().a;
          d2 = localn.e().b - localn.d().b;
        } while (bool2);
        if (bool2) {
          break label329;
        }
        if (!bool1) {
          break label315;
        }
        b = localtb.n();
        do
        {
          if (b - 1 < 0) {
            break label263;
          }
          if (bool1) {
            break;
          }
          if (!paramld.f(localtb.b(b - 1).b(), localtb.b(b - 1).c())) {
            break label263;
          }
          b--;
        } while (!bool1);
        localn = localy.a(b);
        d1 = localn.d().a - localn.e().a;
      } while (bool2);
      double d2 = localn.d().b - localn.e().b;
      byte b = -1;
      if (!bool2) {
        if (Math.abs(d1) > Math.abs(d2))
        {
          if (bool2) {
            break label422;
          }
          if (Math.abs(d2) >= 0.001D) {
            break label421;
          }
          if (!bool2) {}
          b = (byte)(d1 > 0.0D ? 1 : 3);
          if (bool2) {
            break label422;
          }
          if (!bool1) {
            break label421;
          }
        }
      }
      if (!bool2) {
        if (Math.abs(d1) < 0.001D)
        {
          if (!bool2) {}
          b = (byte)(d2 > 0.0D ? 2 : 0);
        }
      }
      if (!bool2)
      {
        if (paramByte == b) {
          i++;
        }
        localm2.f();
      }
    } while (!bool1);
    label263:
    label315:
    label329:
    return i;
  }
  
  void b(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    this.hb = paramBoolean;
    if (!bool2)
    {
      if (this.H)
      {
        this.kb = null;
        this.qb = null;
        this.ob = null;
        this.pb = null;
      }
    }
    else
    {
      g localg = k();
      this.m = b(paramDouble1, paramDouble2);
      if (!bool2) {
        if (this.m == null)
        {
          g();
          return;
        }
      }
      if (!bool2)
      {
        if (!acceptSourceNode(this.m, paramDouble1, paramDouble2))
        {
          sourceNodeDeclined(this.m, paramDouble1, paramDouble2);
          return;
        }
        if (bool2) {}
      }
      else if (a(localg, this.m))
      {
        this.ob = a(this.m, paramDouble1, paramDouble2);
        if (bool2) {
          break label185;
        }
        if (acceptSourceNodePort(this.m, this.ob, paramDouble1, paramDouble2)) {
          break label184;
        }
        a(this.m, this.ob, paramDouble1, paramDouble2);
        return;
      }
      this.ob = null;
      label184:
      label185:
      if (!bool2) {
        if (this.M == null)
        {
          this.M = new KeyListener()
          {
            private void a(KeyEvent paramAnonymousKeyEvent)
            {
              boolean bool = ld.E;
              if ((bool) || (pf.this.c()))
              {
                if (!bool) {}
                if ((((paramAnonymousKeyEvent.getModifiers() & pf.this.o()) != 0) != pf.this.hb) && ((bool) || (pf.this.u != null)) && ((bool) || (pf.this.t != null)))
                {
                  if (!bool)
                  {
                    if (pf.this.u.getWhen() < pf.this.t.getWhen())
                    {
                      if (!bool) {
                        if (pf.this.v != null)
                        {
                          if (bool) {
                            break label229;
                          }
                          if (pf.this.v.getWhen() >= pf.this.t.getWhen()) {
                            return;
                          }
                        }
                      }
                      if (bool) {
                        break label236;
                      }
                      pf.this.mouseDragged(new MouseEvent(pf.this.t.getComponent(), pf.this.t.getID(), pf.this.t.getWhen() + 1L, paramAnonymousKeyEvent.getModifiersEx(), pf.this.t.getX(), pf.this.t.getY(), 0, false));
                      if (!ld.D) {
                        label229:
                        return;
                      }
                    }
                    label236:
                    if (bool) {}
                  }
                  else if (pf.this.v != null)
                  {
                    if ((!bool) && (pf.this.v.getWhen() >= pf.this.u.getWhen())) {
                      return;
                    }
                  }
                  pf.this.mouseMoved(new MouseEvent(pf.this.u.getComponent(), pf.this.u.getID(), pf.this.u.getWhen() + 1L, paramAnonymousKeyEvent.getModifiersEx(), pf.this.u.getX(), pf.this.u.getY(), 0, false));
                }
              }
            }
            
            public void keyTyped(KeyEvent paramAnonymousKeyEvent) {}
            
            public void keyPressed(KeyEvent paramAnonymousKeyEvent)
            {
              a(paramAnonymousKeyEvent);
            }
            
            public void keyReleased(KeyEvent paramAnonymousKeyEvent)
            {
              boolean bool = ld.E;
              a(paramAnonymousKeyEvent);
              if (!bool)
              {
                if (!pf.this.L)
                {
                  if (bool) {
                    break label87;
                  }
                  if (pf.this.U)
                  {
                    if (bool) {
                      break label87;
                    }
                    if (pf.this.P != 0)
                    {
                      if (bool) {
                        break label87;
                      }
                      if (paramAnonymousKeyEvent.getKeyCode() == pf.this.P) {
                        pf.this.Q();
                      }
                    }
                  }
                }
                if (bool) {
                  break label105;
                }
              }
              if (!pf.this.U)
              {
                label87:
                pf.this.i.removeKeyListener(this);
                label105:
                pf.this.M = null;
              }
            }
          };
          this.i.B().addKeyListener(this.M);
        }
      }
      if (!bool2)
      {
        if (this.N == null)
        {
          this.N = new u()
          {
            public void a(cb paramAnonymouscb)
            {
              if ((ld.E) || ((paramAnonymouscb.a() == 3) && (paramAnonymouscb.b().equals(pf.this.m)))) {
                pf.this.Q();
              }
            }
          };
          localg.a(this.N);
        }
        this.i.addPropertyChangeListener("Graph2D", this.O);
        this.Q.o();
        this.kb = null;
        this.qb = null;
        this.i.a(this.Q);
        a(true);
        this.S = this.Q.a(a(localg.w(this.m)));
        this.R = this.Q.a(c(paramDouble1, paramDouble2));
        this.T = this.Q.a(this.S, this.R, H());
        this.I = false;
        localg.b((byte)1);
        this.i.e(3);
        this.G = true;
        this.H = false;
        this.U = true;
        this.V = false;
      }
      ld localld = this.Q.w(this.S);
      double d1 = paramDouble1 - localld.A();
      double d2 = paramDouble2 - localld.B();
      a(localg);
      z localz = v();
      localz.a(this.i);
      List localList1 = Collections.EMPTY_LIST;
      List localList2 = localz.B() ? Collections.singletonList(this.R) : localList1;
      if (!bool2)
      {
        if (M())
        {
          if (bool2) {
            break label547;
          }
          if (B()) {}
        }
        else
        {
          if (bool2) {
            break label557;
          }
        }
      }
      else {
        if (!localz.B()) {
          break label555;
        }
      }
      localz.a(new a.d.w(paramDouble1, paramDouble2), localList2, localList1, Collections.EMPTY_SET, a.i.q.a(null));
      label547:
      if (!bool2)
      {
        if (bool1) {
          label555:
          label557:
          localz.g();
        }
        if (bool2) {}
      }
      else if (M())
      {
        if (bool2) {
          break label599;
        }
        if (B())
        {
          localz.b(this.fb);
          this.fb = null;
        }
      }
      label599:
      if (!bool2) {
        if (this.ob != null)
        {
          if (bool2) {
            break label656;
          }
          this.Q.w(this.S).c(jd.f(this.ob)).a(this.Q.t(this.T));
          if (!bool1) {
            return;
          }
        }
      }
      label656:
      a.d.w localw = getSourcePortOffset(paramBoolean, this.m, d1, d2);
      this.Q.t(this.T).k().b(localw.a, localw.b);
    }
  }
  
  protected e b(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (y())
      {
        sc localsc = a(paramDouble1, paramDouble2);
        if (!bool) {
          if (localsc.x()) {
            return localsc.m();
          }
        }
        if ((bool) || (localsc.t())) {
          return localsc.s().b().n();
        }
        return null;
      }
    }
    return a(paramDouble1, paramDouble2).m();
  }
  
  private void a(g paramg)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (!this.db) {
        this.bb = (this.cb = null);
      }
    }
    this.bb = new ArrayList();
    a.c.w localw = paramg.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      ld localld = paramg.w(localw.d());
      if (bool2) {
        return;
      }
      if (bool1) {
        break label170;
      }
      if (!bool2)
      {
        if (this.i.getVisibleRect().intersects(localld.a(), localld.b(), localld.c(), localld.d())) {
          this.bb.add(localld);
        }
        localw.f();
      }
    } while (!bool1);
    l.a(this.bb, new Comparator()
    {
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        ld localld1 = (ld)paramAnonymousObject1;
        ld localld2 = (ld)paramAnonymousObject2;
        return l.a(localld1.A(), localld2.A());
      }
    });
    this.cb = new ArrayList(this.bb);
    if (!bool2) {
      label170:
      l.a(this.cb, new Comparator()
      {
        public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
        {
          ld localld1 = (ld)paramAnonymousObject1;
          ld localld2 = (ld)paramAnonymousObject2;
          return l.a(localld1.B(), localld2.B());
        }
      });
    }
  }
  
  private ld a(double paramDouble, List paramList)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (((bool2) || (paramList != null)) && ((bool2) || (paramList.size() > 0)))
    {
      int i = 0;
      int j = paramList.size() - 1;
      if (!bool2) {
        if (((ld)paramList.get(i)).A() > paramDouble) {
          return (ld)paramList.get(i);
        }
      }
      if (!bool2) {
        if (((ld)paramList.get(j)).A() < paramDouble) {
          return (ld)paramList.get(j);
        }
      }
      label212:
      do
      {
        int k;
        do
        {
          if (i >= j - 1) {
            break label215;
          }
          k = (i + j) / 2;
          ld localld = (ld)paramList.get(k);
          if (bool2) {
            break label239;
          }
          if (bool1) {
            break label235;
          }
          if (!bool2) {
            if (localld.A() == paramDouble) {
              return localld;
            }
          }
          if (bool2) {
            break label212;
          }
          if (localld.A() >= paramDouble) {
            break;
          }
          i = k;
          if (bool2) {
            break label212;
          }
        } while (!bool1);
        j = k;
      } while (!bool1);
      label215:
      if (!bool2) {}
      label235:
      label239:
      double d1 = Math.abs(((ld)paramList.get(i)).A() - paramDouble);
      double d2 = Math.abs(((ld)paramList.get(j)).A() - paramDouble);
      if (d1 < d2) {
        return (ld)paramList.get(i);
      }
      return (ld)paramList.get(j);
    }
    return null;
  }
  
  private ld b(double paramDouble, List paramList)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (((bool2) || (paramList != null)) && ((bool2) || (paramList.size() > 0)))
    {
      int i = 0;
      int j = paramList.size() - 1;
      if (!bool2) {
        if (((ld)paramList.get(i)).B() > paramDouble) {
          return (ld)paramList.get(i);
        }
      }
      if (!bool2) {
        if (((ld)paramList.get(j)).B() < paramDouble) {
          return (ld)paramList.get(j);
        }
      }
      label212:
      do
      {
        int k;
        do
        {
          if (i >= j - 1) {
            break label215;
          }
          k = (i + j) / 2;
          ld localld = (ld)paramList.get(k);
          if (bool2) {
            break label239;
          }
          if (bool1) {
            break label235;
          }
          if (!bool2) {
            if (localld.B() == paramDouble) {
              return localld;
            }
          }
          if (bool2) {
            break label212;
          }
          if (localld.B() >= paramDouble) {
            break;
          }
          i = k;
          if (bool2) {
            break label212;
          }
        } while (!bool1);
        j = k;
      } while (!bool1);
      label215:
      if (!bool2) {}
      label235:
      label239:
      double d1 = Math.abs(((ld)paramList.get(i)).B() - paramDouble);
      double d2 = Math.abs(((ld)paramList.get(j)).B() - paramDouble);
      if (d1 < d2) {
        return (ld)paramList.get(i);
      }
      return (ld)paramList.get(j);
    }
    return null;
  }
  
  protected a.d.w getSourcePortOffset(boolean paramBoolean, e parame, double paramDouble1, double paramDouble2)
  {
    if (paramBoolean)
    {
      ld localld = k().w(parame);
      double d1 = localld.A() + paramDouble1;
      double d2 = localld.B() + paramDouble2;
      double d3 = a(d1) - localld.A();
      double d4 = b(d2) - localld.B();
      return new a.d.w(d3, d4);
    }
    return a.d.w.c;
  }
  
  private boolean a(g paramg, e parame)
  {
    if ((y()) && (parame != null)) {
      if (ld.E) {}
    }
    return paramg.w(parame).y() > 0;
  }
  
  protected jd a(e parame, double paramDouble1, double paramDouble2)
  {
    return c(parame, paramDouble1, paramDouble2);
  }
  
  private jd c(e parame, double paramDouble1, double paramDouble2)
  {
    ld localld = this.i.a().w(parame);
    return jd.a(localld, paramDouble1, paramDouble2);
  }
  
  protected tb H()
  {
    return k().O().e();
  }
  
  protected tb I()
  {
    boolean bool = ld.E;
    if ((bool) || (this.Q != null))
    {
      if (bool) {
        break label44;
      }
      if (this.Q.l() >= 1) {}
    }
    else
    {
      throw new IllegalStateException("EdgeRealizer not yet created!");
    }
    label44:
    return this.Q.t(this.T);
  }
  
  protected ld a(ld paramld)
  {
    return paramld.m();
  }
  
  protected ld c(double paramDouble1, double paramDouble2)
  {
    od localod = new od();
    localod.b(0.1D, 0.1D);
    localod.d(false);
    localod.c(paramDouble1, paramDouble2);
    localod.b((byte)0);
    return localod;
  }
  
  protected ld J()
  {
    boolean bool = ld.E;
    if ((bool) || (this.Q != null))
    {
      if (bool) {
        break label44;
      }
      if (this.Q.l() >= 1) {}
    }
    else
    {
      throw new IllegalStateException("Edge not yet created!");
    }
    label44:
    return this.Q.w(this.T.f());
  }
  
  protected ld K()
  {
    boolean bool = ld.E;
    if ((bool) || (this.Q != null))
    {
      if (bool) {
        break label44;
      }
      if (this.Q.l() >= 1) {}
    }
    else
    {
      throw new IllegalStateException("Edge not yet created!");
    }
    label44:
    return this.Q.w(this.T.e());
  }
  
  public void mouseReleasedRight(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    this.L = false;
    if (!bool) {
      if (!this.U) {
        return;
      }
    }
    g localg = k();
    tb localtb = this.Q.t(this.T);
    int i = localtb.n();
    if (!bool) {}
    if (i > Math.max(localtb.r(), M() ? 1 : 0))
    {
      a(localtb, i - 1);
      a(localtb);
      if (!bool)
      {
        if (v().n())
        {
          v().b(this.fb);
          this.fb = null;
          eb localeb = I().q();
          if (localeb != null)
          {
            a.d.w localw1 = v().l();
            double d1 = paramDouble1 - localw1.a;
            double d2 = paramDouble2 - localw1.b;
            a.d.w localw2 = new a.d.w(paramDouble1 - d1, paramDouble2 - d2);
            if (!bool) {}
            int j = this.gb != (I().n() % 2 == 1) ? 1 : 0;
            a.d.w localw3 = j != 0 ? new a.d.w(localw2.a(), localeb.c()) : new a.d.w(localeb.b(), localw2.b());
            z.r_ localr_1 = new z.r_(null, localw3, (byte)(j != 0 ? 1 : 2));
            z.r_ localr_2 = new z.r_(null, localw2, (byte)3);
            this.fb = v().a(localr_1, localr_2);
          }
          v().i();
        }
        this.i.b();
        if (bool) {}
      }
      else if (!ld.D)
      {
        return;
      }
    }
    else
    {
      Q();
      localg.gb();
    }
    g();
  }
  
  protected void a(tb paramtb, int paramInt)
  {
    paramtb.a(paramtb.b(paramInt));
  }
  
  private void a(tb paramtb)
  {
    ld localld = paramtb.g();
    zd localzd = paramtb.l();
    a(localzd.a(localld), localzd.b(localld), paramtb);
  }
  
  public void mouseShiftReleasedLeft(double paramDouble1, double paramDouble2)
  {
    this.L = false;
    c(paramDouble1, paramDouble2, true);
  }
  
  public void mouseReleasedLeft(double paramDouble1, double paramDouble2)
  {
    this.L = false;
    c(paramDouble1, paramDouble2, false);
  }
  
  public int L()
  {
    return this.rb;
  }
  
  public void d(int paramInt)
  {
    this.rb = paramInt;
  }
  
  protected boolean c(MouseEvent paramMouseEvent)
  {
    if (!ld.E) {}
    return (paramMouseEvent.getModifiers() & L()) != 0;
  }
  
  void c(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    if (!bool3)
    {
      if (!this.U) {
        return;
      }
      if (bool3) {}
    }
    else
    {
      if (this.hb == paramBoolean) {
        break label43;
      }
    }
    this.hb = paramBoolean;
    label43:
    Point2D.Double localDouble = new Point2D.Double(paramDouble1, paramDouble2);
    localDouble.x = a(localDouble.x);
    localDouble.y = b(localDouble.y);
    boolean bool1 = a(localDouble, I(), c(this.v));
    double d1 = localDouble.x;
    double d2 = localDouble.y;
    g localg = k();
    e locale = e(paramDouble1, paramDouble2);
    tb localtb = this.Q.t(this.T);
    if (!bool3) {
      if (acceptBend(this.m, locale, localDouble.x, localDouble.y))
      {
        if (!bool3)
        {
          if (!this.J) {
            return;
          }
          a(localtb, d1, d2);
          mouseMoved(paramDouble1, paramDouble2);
        }
        if (!bool3)
        {
          if (v().n())
          {
            v().b(this.fb);
            this.fb = null;
            localObject1 = I().q();
            if (bool3) {
              break label444;
            }
            if (localObject1 != null)
            {
              localObject2 = v().l();
              double d3 = paramDouble1 - ((a.d.w)localObject2).a;
              double d5 = paramDouble2 - ((a.d.w)localObject2).b;
              a.d.w localw1 = new a.d.w(localDouble.x - d3, localDouble.y - d5);
              if (!bool3) {}
              int i = this.gb != (I().n() % 2 == 1) ? 1 : 0;
              a.d.w localw3 = i != 0 ? new a.d.w(localw1.a(), ((eb)localObject1).c()) : new a.d.w(((eb)localObject1).b(), localw1.b());
              z.r_ localr_1 = new z.r_(null, localw3, (byte)(i != 0 ? 1 : 2));
              z.r_ localr_2 = new z.r_(null, localw1, (byte)3);
              this.fb = v().a(localr_1, localr_2);
              v().i();
            }
          }
          localg.gb();
        }
        label444:
        if (!bool3) {
          if (!bool2) {
            return;
          }
        }
      }
      else
      {
        if (bool3) {
          break label484;
        }
      }
    }
    if (!this.V)
    {
      if ((bool3) || (O())) {
        Q();
      }
      return;
    }
    label484:
    if (!bool3) {
      if (this.m == locale)
      {
        if (bool3) {
          break label519;
        }
        if (!this.K) {
          return;
        }
      }
    }
    label519:
    Object localObject2 = (bool3) || (this.I) ? this.m : locale;
    if (!bool3)
    {
      if (!acceptTargetNode((e)localObject2, localDouble.x, localDouble.y))
      {
        targetNodeDeclined((e)localObject2, localDouble.x, localDouble.y);
        return;
      }
      if (bool3) {}
    }
    else if (a(localg, (e)localObject2))
    {
      this.pb = d((e)localObject2, d1, d2);
      if (bool3) {
        break label683;
      }
      if (acceptTargetNodePort((e)localObject2, this.pb, d1, d2)) {
        break label646;
      }
      b((e)localObject2, this.pb, d1, d2);
      return;
    }
    this.pb = null;
    label646:
    this.i.b(this.Q);
    this.Q.a(this.T);
    localg.b((byte)0);
    this.i.e(0);
    label683:
    Object localObject1 = createEdge(localg, this.m, (e)localObject2, localtb);
    this.bb = (this.cb = null);
    v().g();
    if (!bool3)
    {
      if (localObject1 != null)
      {
        localtb = localg.t((d)localObject1);
        ld localld = localg.w((e)localObject2);
        double d4 = d1 - localld.A();
        double d6 = d2 - localld.B();
        if (!bool3) {
          if (this.pb != null)
          {
            localw2 = jd.c(this.pb);
            if (bool3) {
              break label866;
            }
            if (!bool2) {
              break label816;
            }
          }
        }
        a.d.w localw2 = getTargetPortOffset((d)localObject1, paramBoolean, (e)localObject2, d4, d6, bool1, d1, d2);
        label816:
        localtb.l().b(localw2.a, localw2.b);
        a(localg.s((d)localObject1).a, localg.s((d)localObject1).b, localtb);
        a((d)localObject1);
        label866:
        edgeCreated((d)localObject1);
      }
      a(false);
      localg.gb();
    }
    g();
  }
  
  protected sc d(double paramDouble1, double paramDouble2)
  {
    int i = 1;
    if (!ld.E) {
      if (y()) {
        i |= 0x40;
      }
    }
    return this.i.P().a(paramDouble1, paramDouble2, i, true);
  }
  
  protected e e(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (y())
      {
        sc localsc = d(paramDouble1, paramDouble2);
        if (!bool) {
          if (localsc.x()) {
            return localsc.m();
          }
        }
        if ((bool) || (localsc.t())) {
          return localsc.s().b().n();
        }
        return null;
      }
    }
    return d(paramDouble1, paramDouble2).m();
  }
  
  private void a(d paramd)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    tb localtb = k().t(paramd);
    if (!bool2) {
      if (localtb.r() > 0) {
        return;
      }
    }
    ld localld = localtb.g();
    if (!bool2) {
      if (M())
      {
        if (!bool2) {
          if (paramd.g())
          {
            a.d.w localw = k().r(paramd);
            eb localeb1;
            if (!bool2) {
              if (localtb.n() == 0)
              {
                if (bool2) {
                  break label507;
                }
                localeb1 = localtb.c(localw.a, localld.b() - 15.0D);
                if (localeb1 == null) {
                  break label506;
                }
                if (bool2) {
                  break label507;
                }
                localeb1 = localtb.c(localld.a() + localld.c() + 15.0D, localeb1.c());
                if (localeb1 == null) {
                  break label506;
                }
                localtb.c(localeb1.b(), k().s(paramd).b);
                if (bool2) {
                  break label510;
                }
                if (!bool1) {
                  break label506;
                }
              }
            }
            if (bool2) {
              break label510;
            }
            if (localtb.n() == 1)
            {
              localeb1 = localtb.p();
              double d1 = localw.a - localeb1.b();
              double d2 = localw.b - localeb1.c();
              if (!bool2)
              {
                if (d1 == 0.0D)
                {
                  if (bool2) {
                    break label293;
                  }
                  if (d2 == 0.0D)
                  {
                    localeb1.a(localw.a, localld.b() - 15.0D);
                    d2 = localw.b - localeb1.c();
                  }
                }
                if (bool2) {
                  break label411;
                }
              }
              label293:
              double d3;
              eb localeb2;
              if (Math.abs(d1) > Math.abs(d2))
              {
                if (!bool2) {}
                d3 = Math.max(15.0D, d1 > 0.0D ? localeb1.b() - (localld.a() + localld.c()) : localeb1.b() - localld.a());
                if (bool2) {
                  break label507;
                }
                localeb2 = localtb.c(localeb1.b(), localld.b() - Math.abs(d3));
                if (localeb2 != null)
                {
                  localtb.c(k().s(paramd).a, localeb2.c());
                  if (bool2) {
                    break label510;
                  }
                  if (!bool1) {}
                }
              }
              else
              {
                label411:
                if (!bool2) {}
                d3 = Math.max(15.0D, d2 > 0.0D ? localeb1.c() - (localld.b() + localld.d()) : localeb1.c() - localld.b());
                if (bool2) {
                  break label507;
                }
                localeb2 = localtb.c(localld.a() - Math.abs(d3), localeb1.c());
                if (localeb2 != null) {
                  localtb.c(localeb2.b(), k().s(paramd).b);
                }
              }
            }
          }
        }
        label506:
        label507:
        label510:
        cg.a(localtb);
      }
    }
    if (this.jb) {
      cg.e(localtb);
    }
  }
  
  protected void a(tb paramtb, double paramDouble1, double paramDouble2)
  {
    paramtb.c(paramDouble1, paramDouble2);
  }
  
  protected a.d.w getTargetPortOffset(boolean paramBoolean, e parame, double paramDouble1, double paramDouble2)
  {
    if (paramBoolean)
    {
      ld localld = k().w(parame);
      double d1 = localld.A() + paramDouble1;
      double d2 = localld.B() + paramDouble2;
      double d3 = a(d1) - localld.A();
      double d4 = b(d2) - localld.B();
      return new a.d.w(d3, d4);
    }
    return a.d.w.c;
  }
  
  protected jd d(e parame, double paramDouble1, double paramDouble2)
  {
    return c(parame, paramDouble1, paramDouble2);
  }
  
  protected a.d.w getTargetPortOffset(d paramd, boolean paramBoolean1, e parame, double paramDouble1, double paramDouble2, boolean paramBoolean2, double paramDouble3, double paramDouble4)
  {
    boolean bool = ld.E;
    tb localtb = k().t(paramd);
    a.d.w localw1 = (bool) || (localtb.n() > 0) ? localtb.q().e() : k().r(paramd);
    ld localld = localtb.g();
    a.d.w localw2 = paramBoolean2 ? new a.d.w(paramDouble3, paramDouble4) : new a.d.w(localld.A() + paramDouble1, localld.B() + paramDouble2);
    double d1 = localw1.a - localw2.a;
    double d2 = localw1.b - localw2.b;
    if (!bool) {
      if ((this.mb) && ((bool) || ((Math.abs(d1) < 0.1D) || ((bool) || (Math.abs(d2) < 0.1D)))))
      {
        if (!bool) {
          if (Math.abs(d1) > Math.abs(d2))
          {
            if (!bool) {}
            b = (byte)(d1 > 0.0D ? 1 : 3);
            if ((!bool) && (!ld.D)) {
              break label242;
            }
          }
        }
        if (!bool) {}
        byte b = (byte)(d2 > 0.0D ? 2 : 0);
        label242:
        a.c.q localq = paramd.c();
        localq.f(paramd);
        if (!bool) {}
        int i = b >= 0 ? a(b, localld) : 0;
        localq.g(paramd);
        if (i == 0) {
          return getTargetPortOffset(paramBoolean1, parame, paramDouble1, paramDouble2);
        }
        double d3 = paramDouble3 - localld.A();
        double d4 = paramDouble4 - localld.B();
        return new a.d.w(d3, d4);
      }
    }
    return getTargetPortOffset(paramBoolean1, parame, paramDouble1, paramDouble2);
  }
  
  protected d createEdge(g paramg, e parame1, e parame2, tb paramtb)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (paramg == parame1.g())
      {
        if (bool) {
          break label89;
        }
        if (paramg == parame2.g()) {
          break label87;
        }
      }
    }
    if (!bool)
    {
      j localj = paramg.K();
      if (localj != null)
      {
        paramg.z();
        d locald;
        try
        {
          locald = localj.a(parame1, parame2);
          paramg.a(locald, paramtb);
        }
        finally
        {
          paramg.A();
        }
        return locald;
      }
    }
    label87:
    label89:
    return paramg.a(parame1, parame2, paramtb);
  }
  
  protected boolean acceptBend(e parame1, e parame2, double paramDouble1, double paramDouble2)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    boolean bool1 = parame2 == null;
    if (!bool3) {
      if (!bool1)
      {
        j localj = j.a(k());
        if (localj != null)
        {
          ld localld = k().w(parame2);
          if (bool3) {
            break label273;
          }
          if (localj.m(parame2))
          {
            if (!bool3) {
              if (isConnectOnGroupNodeLabelEnabled())
              {
                sc localsc = f(paramDouble1, paramDouble2);
                a.c.y localy = localsc.i();
                do
                {
                  if (!localy.e()) {
                    break;
                  }
                  jg localjg = (jg)localy.j();
                  if (bool3) {
                    break label273;
                  }
                  if (bool2) {
                    break label271;
                  }
                  if (((bool3) || (localjg.gb() == parame2)) && (localld.b(0) == localjg)) {
                    return false;
                  }
                  localy.f();
                } while (!bool2);
              }
            }
            int i = getGroupBorderWidth();
            if ((bool3) || (bool3)) {
              break label273;
            }
            if (paramDouble1 >= localld.a() + i)
            {
              if (bool3) {
                break label273;
              }
              if (paramDouble1 <= localld.a() + localld.c() - i)
              {
                if (bool3) {
                  break label273;
                }
                if (paramDouble2 >= localld.b() + i)
                {
                  if (bool3) {
                    break label273;
                  }
                  if (paramDouble2 <= localld.b() + localld.d() - i) {
                    return true;
                  }
                }
              }
            }
          }
        }
      }
    }
    label271:
    label273:
    return bool1;
  }
  
  public void mouseDraggedLeft(double paramDouble1, double paramDouble2)
  {
    boolean bool4 = ld.E;
    boolean bool3 = ld.D;
    if (!bool4) {
      if (!this.U) {
        return;
      }
    }
    MouseEvent localMouseEvent = this.t;
    if (!bool4) {
      if (this.t != null)
      {
        if (bool4) {
          break label83;
        }
        if (this.u != null)
        {
          if (bool4) {
            break label86;
          }
          if (this.u.getWhen() > this.t.getWhen()) {
            localMouseEvent = this.u;
          }
        }
      }
    }
    label83:
    label86:
    boolean bool1 = this.gb;
    if (localMouseEvent != null)
    {
      if (bool4) {
        break label194;
      }
      if (this.hb != b(localMouseEvent))
      {
        if (!bool4) {}
        this.hb = (!this.hb);
        if (bool4) {
          break label193;
        }
        if (this.hb)
        {
          if (bool4) {
            break label194;
          }
          if (I().n() == 1)
          {
            if (!bool4) {}
            this.gb = (!this.gb);
          }
        }
      }
    }
    if (!bool4) {
      label193:
      if (I().n() < 2)
      {
        label194:
        if (bool4) {
          break label303;
        }
        if (M())
        {
          if (bool4) {
            break label303;
          }
          if (this.s != null) {
            if (!bool4)
            {
              if (localMouseEvent != null) {
                if (bool4) {
                  break label303;
                }
              }
            }
            else if (this.s.getWhen() + 200L > localMouseEvent.getWhen())
            {
              int i = localMouseEvent.getX() - this.s.getX();
              int j = localMouseEvent.getY() - this.s.getY();
              this.gb = a(i, j, this.m);
            }
          }
        }
      }
    }
    label303:
    g localg = k();
    Point2D.Double localDouble = new Point2D.Double(paramDouble1, paramDouble2);
    e locale = determineHitNode(localg, localDouble.x, localDouble.y);
    if (locale != this.m) {
      this.V = true;
    }
    boolean bool2 = a(localg, locale);
    this.kb = null;
    this.qb = null;
    if (!bool4)
    {
      if (this.lb) {
        if (!bool4)
        {
          if (!this.V)
          {
            if (bool4) {
              break label540;
            }
            if (!this.I) {}
          }
          else
          {
            if (bool4) {
              break label540;
            }
          }
        }
        else if (!acceptBend(this.m, locale, paramDouble1, paramDouble2))
        {
          if (bool4) {
            break label540;
          }
          if (acceptTargetNode(locale, localDouble.x, localDouble.y))
          {
            this.kb = locale;
            if (bool4) {
              break label539;
            }
            if (bool2)
            {
              this.qb = d(locale, paramDouble1, paramDouble2);
              if (bool4) {
                break label540;
              }
              if (!acceptTargetNodePort(this.kb, this.qb, paramDouble1, paramDouble2))
              {
                this.kb = null;
                this.qb = null;
              }
            }
          }
        }
      }
      localDouble.x = a(localDouble.x);
      localDouble.y = b(localDouble.y);
    }
    label539:
    label540:
    tb localtb = I();
    Object localObject;
    if (!bool4)
    {
      a(localDouble, localtb, P());
      if (locale == this.m)
      {
        if (bool4) {
          break label814;
        }
        if (this.K)
        {
          if (!bool4) {
            if (bool2)
            {
              if (bool4) {
                break label811;
              }
              if (this.qb == null) {
                break label810;
              }
            }
          }
          if (!bool4) {
            if (!this.G)
            {
              this.G = true;
              if (bool4) {
                break label950;
              }
              if (localtb.n() != localtb.r()) {
                break label895;
              }
              this.Q.a(this.T);
              this.T = this.Q.a(this.S, this.S, localtb);
              this.I = true;
              if (bool4) {
                break label943;
              }
              if (!bool2) {
                break label895;
              }
              if (bool4) {
                break label940;
              }
              if (this.qb == null) {
                break label895;
              }
              k = jd.f(this.qb);
              localObject = this.Q.w(this.S).c(k);
              ((jd)localObject).c(localtb);
              if (bool4) {
                break label943;
              }
              if (!bool3) {
                break label895;
              }
            }
          }
          if (bool4) {
            break label943;
          }
          if (!this.I) {
            break label895;
          }
          if (bool4) {
            break label943;
          }
          if (!bool2) {
            break label895;
          }
          int k = jd.f(this.qb);
          localObject = this.Q.w(this.S).c(k);
          ((jd)localObject).c(localtb);
          if (bool4) {
            break label943;
          }
          if (!bool3) {
            break label895;
          }
        }
      }
    }
    label810:
    label811:
    label814:
    if (!bool4)
    {
      if (this.G)
      {
        this.G = false;
        if (bool4) {
          break label943;
        }
        if (this.I)
        {
          this.Q.a(this.T);
          localtb.s();
          this.T = this.Q.a(this.S, this.R, localtb);
          this.I = false;
          jd.b(null, localtb);
          localtb.b(a.d.w.c);
        }
      }
      label895:
      this.Q.w(this.R).c(localDouble.x, localDouble.y);
      a(localDouble);
      edgeMoved(localDouble.x, localDouble.y);
    }
    label940:
    label943:
    if (!bool4)
    {
      if (this.gb == bool1)
      {
        label950:
        if (bool4) {
          break label1185;
        }
        if (this.fb != null) {}
      }
      else
      {
        if (bool4) {
          break label1185;
        }
      }
    }
    else if (v().n())
    {
      v().b(this.fb);
      this.fb = null;
      eb localeb = I().q();
      if (localeb != null)
      {
        localObject = v().l();
        double d1 = paramDouble1 - ((a.d.w)localObject).a;
        double d2 = paramDouble2 - ((a.d.w)localObject).b;
        a.d.w localw1 = new a.d.w(localDouble.x - d1, localDouble.y - d2);
        if (!bool4) {}
        int n = !this.gb ? 1 : 0;
        a.d.w localw2 = n != 0 ? new a.d.w(localw1.a(), localeb.c()) : new a.d.w(localeb.b(), localw1.b());
        z.r_ localr_1 = new z.r_(null, localw2, (byte)(!this.gb ? 1 : 2));
        z.r_ localr_2 = new z.r_(null, localw1, (byte)3);
        this.fb = v().a(localr_1, localr_2);
      }
      v().i();
    }
    label1185:
    this.i.b();
  }
  
  protected boolean a(int paramInt1, int paramInt2, e parame)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (Math.abs(paramInt1) > Math.abs(paramInt2))
      {
        if (!bool) {}
        b = (byte)(paramInt1 > 0 ? 1 : 3);
        if (bool) {
          break label79;
        }
        if (!ld.D) {
          break label66;
        }
      }
    }
    if (!bool) {}
    byte b = (byte)(paramInt2 > 0 ? 2 : 0);
    label66:
    label79:
    if (!bool) {
      if (a(b, k().w(parame)) == 0)
      {
        if (!bool) {}
        return Math.abs(paramInt2) > Math.abs(paramInt1);
      }
    }
    if (!bool) {}
    return Math.abs(paramInt1) > Math.abs(paramInt2);
  }
  
  private boolean a(Point2D.Double paramDouble, tb paramtb, boolean paramBoolean)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (paramBoolean)
      {
        v().i();
        return false;
      }
    }
    if (!bool2) {
      if (v().n())
      {
        a.d.w localw1 = new a.d.w(paramDouble.x, paramDouble.y);
        a.d.w localw2 = v().b(localw1);
        paramDouble.x = localw2.a;
        paramDouble.y = localw2.b;
        return localw1 != localw2;
      }
    }
    if (!bool2) {
      if (this.X > 0.0D)
      {
        if (bool2) {
          break label501;
        }
        if (!M())
        {
          if (!bool2) {
            if (paramtb.n() > 0)
            {
              d1 = paramtb.q().b();
              if (bool2) {
                break label169;
              }
              d2 = paramtb.q().c();
              if (!bool1) {
                break label201;
              }
            }
          }
          label169:
          a.d.w localw3 = ((g)paramtb.i().c()).r(paramtb.i());
          double d1 = localw3.a;
          double d2 = localw3.b;
          label201:
          double d3 = Math.abs(paramDouble.x - d1);
          double d4 = Math.abs(paramDouble.y - d2);
          int i = 0;
          int j = 0;
          if (!bool2) {
            if (d3 < d4)
            {
              if (bool2) {
                break label322;
              }
              if (d3 * this.i.M() >= this.X) {
                break label318;
              }
              paramDouble.x = d1;
              i = 1;
              if (bool2) {
                break label322;
              }
              if (!bool1) {
                break label318;
              }
            }
          }
          if (!bool2) {
            if (d4 * this.i.M() < this.X)
            {
              paramDouble.y = d2;
              j = 1;
            }
          }
          label318:
          label322:
          if (!bool2) {
            if (this.db)
            {
              ld localld;
              if (!bool2) {
                if (i == 0)
                {
                  localld = a(paramDouble.x, this.bb);
                  if ((bool2) || (localld != null))
                  {
                    if (bool2) {
                      break label404;
                    }
                    if (Math.abs(localld.A() - paramDouble.x) < this.X)
                    {
                      paramDouble.x = localld.A();
                      i = 1;
                    }
                  }
                }
              }
              if (bool2) {
                break label476;
              }
              if (j == 0)
              {
                localld = b(paramDouble.y, this.cb);
                if ((bool2) || (localld != null))
                {
                  if (bool2) {
                    break label476;
                  }
                  if (Math.abs(localld.B() - paramDouble.y) < this.X)
                  {
                    paramDouble.y = localld.B();
                    j = 1;
                  }
                }
              }
            }
          }
          label404:
          label476:
          if (!bool2) {
            if (i == 0) {
              if (bool2) {
                break label495;
              }
            }
          }
          label495:
          return j != 0;
        }
      }
    }
    label501:
    return false;
  }
  
  private void a(Point2D.Double paramDouble)
  {
    a(paramDouble.x, paramDouble.y, I());
  }
  
  protected e determineHitNode(g paramg, double paramDouble1, double paramDouble2)
  {
    if (paramg.w(this.m).f(paramDouble1, paramDouble2)) {
      return this.m;
    }
    return e(paramDouble1, paramDouble2);
  }
  
  public void mouseMoved(double paramDouble1, double paramDouble2)
  {
    mouseDraggedLeft(paramDouble1, paramDouble2);
  }
  
  public void g()
  {
    S();
    this.U = false;
    this.H = true;
    this.bb = (this.cb = null);
    super.g();
  }
  
  public boolean M()
  {
    return this.W;
  }
  
  public void o(boolean paramBoolean)
  {
    this.W = paramBoolean;
  }
  
  public boolean O()
  {
    return this.Y;
  }
  
  public void p(boolean paramBoolean)
  {
    this.Y = paramBoolean;
  }
  
  public void setGroupBorderWidth(int paramInt)
  {
    this.Z = paramInt;
  }
  
  public int getGroupBorderWidth()
  {
    return this.Z;
  }
  
  public boolean isConnectOnGroupNodeLabelEnabled()
  {
    return this.ab;
  }
  
  public void setConnectOnGroupNodeLabelEnabled(boolean paramBoolean)
  {
    this.ab = paramBoolean;
  }
  
  protected sc f(double paramDouble1, double paramDouble2)
  {
    return new sc(this.i, paramDouble1, paramDouble2, false, 5);
  }
  
  protected Rectangle2D b(ld paramld)
  {
    return new Rectangle2D.Double(paramld.a() - 10.0D, paramld.b() - 10.0D, paramld.c() + 20.0D, paramld.d() + 20.0D);
  }
  
  protected void a(Graphics2D paramGraphics2D, ld paramld)
  {
    xf.c(paramGraphics2D, paramld);
  }
  
  protected void a(Graphics2D paramGraphics2D, jd paramjd)
  {
    t localt = this.qb.o();
    int i = (int)Math.floor(localt.d());
    int j = (int)Math.floor(localt.e());
    int k = (int)Math.ceil(localt.b());
    int n = (int)Math.ceil(localt.c());
    xf.a(paramGraphics2D, i, j, k, n);
  }
  
  protected void edgeMoved(double paramDouble1, double paramDouble2) {}
  
  private void a(double paramDouble1, double paramDouble2, tb paramtb)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!M()) {
      return;
    }
    Point2D.Double localDouble = new Point2D.Double(paramDouble1, paramDouble2);
    if (!bool2) {
      if (paramtb.n() == 0)
      {
        localObject = paramtb.h();
        d1 = paramtb.k().a((ld)localObject);
        d2 = paramtb.k().b((ld)localObject);
        double d3 = localDouble.x - d1;
        double d5 = localDouble.y - d2;
        if (!bool2)
        {
          if (this.gb)
          {
            localDouble.x = (d1 + d3);
            localDouble.y = d2;
            if (bool2) {
              break label156;
            }
            if (!bool1) {}
          }
          else
          {
            localDouble.x = d1;
          }
        }
        else {
          localDouble.y = (d2 + d5);
        }
        label156:
        if (!bool2) {
          if (paramDouble1 == localDouble.x)
          {
            if (!bool2) {
              if (paramDouble2 == localDouble.y) {
                return;
              }
            }
          }
          else
          {
            if (bool2) {
              break label216;
            }
            paramtb.a(localDouble.x, localDouble.y, paramtb.q(), 0);
          }
        }
        if (!bool1) {
          return;
        }
      }
    }
    label216:
    Object localObject = paramtb.q();
    if (!bool2) {
      if (paramtb.n() > 1)
      {
        if (bool2) {
          break label272;
        }
        a.d.w localw = paramtb.a(paramtb.n() - 2);
        d1 = localw.a;
        d2 = localw.b;
        if (!bool1) {
          break label301;
        }
      }
    }
    label272:
    ld localld = paramtb.h();
    double d1 = paramtb.k().a(localld);
    double d2 = paramtb.k().b(localld);
    label301:
    double d4 = localDouble.x - d1;
    double d6 = localDouble.y - d2;
    if (!bool2) {
      if (paramtb.n() > 1)
      {
        if (!bool2) {}
        if ((paramtb.n() % 2 == 0) == this.gb)
        {
          localDouble.x = (d1 + d4);
          localDouble.y = d2;
          if (!bool2) {
            if (!bool1) {
              break label472;
            }
          }
        }
        else
        {
          localDouble.x = d1;
          localDouble.y = (d2 + d6);
        }
        if ((!bool2) && (!bool1)) {
          break label472;
        }
      }
    }
    if (!bool2)
    {
      if (!this.gb)
      {
        localDouble.x = (d1 + d4);
        localDouble.y = d2;
        if (bool2) {
          break label462;
        }
      }
    }
    else {
      if (!bool1) {
        break label472;
      }
    }
    localDouble.x = d1;
    label462:
    localDouble.y = (d2 + d6);
    label472:
    ((eb)localObject).a(localDouble.x, localDouble.y);
  }
  
  private boolean P()
  {
    boolean bool2 = ld.E;
    boolean bool1 = false;
    if (((bool2) || (this.u != null)) && ((bool2) || (this.t != null)))
    {
      if (!bool2) {
        if (this.t.getWhen() > this.u.getWhen())
        {
          bool1 = c(this.t);
          if (bool2) {
            break label79;
          }
          if (!ld.D) {
            return bool1;
          }
        }
      }
      bool1 = c(this.u);
    }
    label79:
    return bool1;
  }
  
  protected void edgeCreated(d paramd)
  {
    if ((ld.E) || (y()))
    {
      tb localtb = this.i.a().t(paramd);
      jd.a(this.ob, localtb);
      jd.b(this.pb, localtb);
    }
  }
  
  protected void Q()
  {
    v().g();
    this.bb = (this.cb = null);
    this.Q.o();
    this.kb = null;
    S();
    k().b((byte)0);
    this.i.e(0);
    this.i.b(this.Q);
    this.i.b();
    a(false);
    g();
  }
  
  protected void sourceNodeDeclined(e parame, double paramDouble1, double paramDouble2)
  {
    g();
  }
  
  protected boolean acceptSourceNode(e parame, double paramDouble1, double paramDouble2)
  {
    return true;
  }
  
  protected void a(e parame, jd paramjd, double paramDouble1, double paramDouble2)
  {
    g();
  }
  
  protected boolean acceptSourceNodePort(e parame, jd paramjd, double paramDouble1, double paramDouble2)
  {
    return true;
  }
  
  protected void targetNodeDeclined(e parame, double paramDouble1, double paramDouble2) {}
  
  protected boolean acceptTargetNode(e parame, double paramDouble1, double paramDouble2)
  {
    return true;
  }
  
  protected void b(e parame, jd paramjd, double paramDouble1, double paramDouble2) {}
  
  protected boolean acceptTargetNodePort(e parame, jd paramjd, double paramDouble1, double paramDouble2)
  {
    return true;
  }
  
  public int R()
  {
    return this.P;
  }
  
  public void e(int paramInt)
  {
    this.P = paramInt;
  }
  
  public void b()
    throws UnsupportedOperationException
  {
    if ((ld.E) || (a())) {
      Q();
    }
  }
  
  private void S()
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.M != null)
      {
        this.i.B().removeKeyListener(this.M);
        this.M = null;
      }
    }
    if (!bool) {
      if (this.N != null)
      {
        k().b(this.N);
        this.N = null;
      }
    }
    this.i.removePropertyChangeListener("Graph2D", this.O);
  }
  
  void q(boolean paramBoolean)
  {
    this.L = paramBoolean;
  }
  
  class f_
    extends g
    implements qb
  {
    f_() {}
    
    public void paint(Graphics2D paramGraphics2D)
    {
      boolean bool = ld.E;
      t(q()).c(paramGraphics2D);
      if (!bool)
      {
        if (!pf.this.lb) {
          return;
        }
        if (bool) {}
      }
      else if (pf.this.y())
      {
        if (bool) {
          break label87;
        }
        if (pf.this.qb != null)
        {
          if (bool) {
            break label87;
          }
          pf.this.a(paramGraphics2D, pf.this.qb);
          if (!ld.D) {
            return;
          }
        }
      }
      label87:
      if ((bool) || (pf.this.kb != null)) {
        pf.this.a(paramGraphics2D, pf.this.k().w(pf.this.kb));
      }
    }
    
    public Rectangle getBounds()
    {
      boolean bool = ld.E;
      Rectangle localRectangle = d();
      if ((bool) || (pf.this.lb))
      {
        Object localObject;
        if (!bool) {
          if (pf.this.kb != null)
          {
            localObject = pf.this.k().w(pf.this.kb);
            localRectangle = localRectangle.union(pf.this.b((ld)localObject).getBounds()).getBounds();
          }
        }
        if (((bool) || (pf.this.y())) && ((bool) || (pf.this.qb != null)))
        {
          localObject = pf.this.qb.o();
          localRectangle.add(((t)localObject).d(), ((t)localObject).e());
          localRectangle.add(((t)localObject).d() + ((t)localObject).b(), ((t)localObject).e() + ((t)localObject).c());
        }
      }
      return localRectangle;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.pf

 * JD-Core Version:    0.7.0.1

 */